store_Ao.prototype.pagerFilter = function(data){
	if (typeof data.length == 'number' && typeof data.splice == 'function'){ // is array
	data = {
	total: data.length,
	rows: data
	}
	}
	var dg = $(this);
	var opts = dg.datagrid('options');
	var pager = dg.datagrid('getPager');
	pager.pagination({
	onSelectPage:function(pageNum, pageSize){
	opts.pageNumber = pageNum;
	opts.pageSize = pageSize;
	pager.pagination('refresh',{
	pageNumber:pageNum,
	pageSize:pageSize
	});
	dg.datagrid('loadData',data);
	}
	});
	if (!data.originalRows){
	data.originalRows = (data.rows);
	}
	var start = (opts.pageNumber-1)*parseInt(opts.pageSize);
	var end = start + parseInt(opts.pageSize);
	data.rows = (data.originalRows.slice(start, end));
	return data;
}
store_Ao.prototype.initTinymce = function($selector){
	tinymce.init({
		selector: $selector,
		theme: "modern",
		//language_url : "",//this.getUrlBase()+"tinymce/langs/vi_VN.js",
		//skin_url : this.getUrlBase()+"tinymce/skins/lightgray",
		//document_base_url: this.getUrlBase()+"tinymce",
		plugins: [
			"advlist autolink lists link image charmap print preview hr anchor pagebreak",
			"searchreplace wordcount visualblocks visualchars code fullscreen",
			"insertdatetime media nonbreaking save table contextmenu directionality",
			"emoticons template paste textcolor"
		],
		toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
		toolbar2: "print preview media | forecolor backcolor emoticons",
		image_advtab: true,
		templates: [
			{title: 'Test template 1', content: 'Test 1'},
			{title: 'Test template 2', content: 'Test 2'}
		]
	});
}

store_Ao.prototype.initKce = function($selector){
	CKEDITOR.replace( $selector, {
	});
}
var CKEDITOR_BASEPATH = 'ckeditor/';

